package com.smartleanx.module.hrm.service.payrollapproverecord;

import com.smartleanx.framework.common.pojo.PageResult;
import com.smartleanx.framework.common.validation.InEnum;
import com.smartleanx.framework.customfield.core.service.bo.inner.CustomFieldDataBaseBO;
import com.smartleanx.module.bpm.enums.task.BpmProcessInstanceStatusEnum;
import com.smartleanx.module.hrm.controller.admin.payrollapproverecord.vo.PayrollApproveRecordPageReqVO;
import com.smartleanx.module.hrm.dal.dataobject.payrollapproverecord.PayrollApproveRecordDO;
import com.smartleanx.module.hrm.service.payrollapproverecord.bo.PayrollApproveRecordDetailSaveBO;

import javax.validation.Valid;
import javax.validation.constraints.NotNull;
import java.util.Collection;

/**
 * 薪资审批记录 Service 接口
 *
 * @author zhangchp
 */
public interface PayrollApproveRecordService {

    /**
     * 创建薪资审批记录
     *
     * @param payrollId 薪资月记录
     */
    void createRecord(Collection<PayrollApproveRecordDetailSaveBO> recordDetailSaveBOs, Collection<CustomFieldDataBaseBO> fieldDataList, Long payrollId);

    /**
     * 更新审核结果
     *
     * @param id ID
     * @param approveResult 审核结果
     */
    void updateApproveResult(@Valid @NotNull(message = "id不能为空") Long id,
                             @NotNull(message = "审核结果不能为空") @InEnum(value = BpmProcessInstanceStatusEnum.class, message = "审核结果格式非法") Integer approveResult);

    /**
     * 获得薪资审批记录
     *
     * @param id 编号
     * @return 薪资审批记录
     */
    PayrollApproveRecordDO getRecord(Long id);

    /**
     * 获得薪资审批记录分页
     *
     * @param pageReqVO 分页查询
     * @return 薪资审批记录分页
     */
    PageResult<PayrollApproveRecordDO> getRecordPage(PayrollApproveRecordPageReqVO pageReqVO);
}